package com.ltmonitor.service.impl;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

import com.ltmonitor.video.entity.TerminalVideoProperty;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ltmonitor.dao.IAdasDeviceStateDao;
import com.ltmonitor.adas.entity.AdasDeviceState;
import com.ltmonitor.service.IAdasDeviceStateService;

@Service("adasDeviceStateService")
public class AdasDeviceStateService extends BaseService<Long, AdasDeviceState> implements IAdasDeviceStateService {

	@Autowired
	private IAdasDeviceStateDao AdasDeviceStateDao;


	/**
	 * 获得车辆终端的Adas外设工作状态
	 * @param vehicleId
	 * @return
	 */
	public AdasDeviceState getAdasDeviceStateByVehicleId(long vehicleId, int adasDeviceId)
	{
		String hql = "from AdasDeviceState where vehicleId = ? and adasId = ?";
		AdasDeviceState t = this.baseDao.find(hql , new Object[]{vehicleId, adasDeviceId});
		return t;
	}

	/**
	 * 下发获取命令，根据命令Id,获得车辆终端的Adas外设工作状态
	 * @param commandId 下发的终端命令id
	 * @return
	 */
	public List<AdasDeviceState> getAdasDeviceStateByCommandId(long commandId)
	{
		String hql = "from AdasDeviceState where commandId = ?";
		return this.baseDao.query(hql, commandId);
	}

}
